export const changeTime = (time) => {
    let prev = Date.now() - new Date(time).getTime();
    let s = 1000,
        m = s * 60,
        h = m * 60,
        day = h * 24;
    if (prev / day >= 1) {
        return Math.round(prev / day) + "天前";
    } else if (prev / h >= 1) {
        return Math.round(prev / h) + "小时前";
    } else if (prev / m) {
        return Math.round(prev / m) + "分钟前";
    } else {
        return Math.round(prev / s) + "秒前";
    }
};
